<!-- 设备误报 -->
<template>
	<view class="page">
		<cu-custom bgColor="bg-white" :isBack="true">
			<block style="color: ##777777;font-size: 32rpx;" slot="content">设备误报</block>
		</cu-custom>
		<view class="content" style="background-color: #fff;">
			<ul>
				<li>
					<text class="list-info">设备名称：</text>
					<text class="list-title">{{sbmc || '暂无'}}</text>
				</li>
				<li>
					<text class="list-info">企业名称：</text>
					<text class="list-title">{{qymc || '暂无'}}</text>
				</li>
				<li>
					<text class="list-info">所在位置：</text>
					<text class="list-title">{{szwz || '暂无'}}</text>
				</li>
				<li>
					<text class="list-info">所在区域：</text>
					<text class="list-title">{{szqy || '暂无'}}</text>
				</li>
			</ul>
		</view>

		<view class="flex btns-group">
			<button class="my-btn-grpup" @click="jswb">结束误报</button>
			<button class="my-btn-grpup" @click="scgd">隐患上报</button>
		</view>
		<u-toast ref="uToast"></u-toast>
		<message />
	</view>
</template>

<script>
	export default {
		onLoad(option) {
			this.equipmentId = option.equipmentId
			this.ucId = option.ucId
			this.xq()
		},
		data() {
			return {
				equipmentId: '',
				ucId: '',
				sbmc: '',
				qymc: '',
				szwz: '',
				szqy: ''
			}
		},
		methods: {
			jswb() {
				let that = this
				let params = {
					ucId: that.ucId,
					feedtype: 0,
					feedback: "设备误报",
					fileUrl: ''
				}
				// 请求数据
				let app = getApp()
				app.globalData.request({
					url: 'wx/fireAlarmInfo/updateInFireAlarmInfo',
					data: {
						...params
					}
				}).then(function(res) {
					that.$refs.uToast.show({
						message: "结束误报成功",
						type: 'success',
						complete() {
							uni.navigateBack({
								delta: 2
							})
						}
					})
				}).catch(function(e) {

				})
			},
			scgd() {
				uni.navigateTo({
					url: '/yzqy/yhgd/yhgd?ucId=' + this.ucId
				});
			},
			xq() {
				// 封装参数
				let that = this
				let params = {
					"ucId": that.equipmentId
				}
				// 请求数据
				let app = getApp()
				app.globalData.request({
					url: 'wx/firealarm/getInEquipmentVo',
					data: {
						...params
					}
				}).then(function(res) {
					console.info(res)
					that.sbmc = res.data.data.disPlayName
					that.qymc = res.data.data.enterpriseName
					that.szwz = res.data.data.address
					that.szqy = res.data.data.regionName

				}).catch(function(e) {

				})
			}
		}
	}
</script>

<style scoped>
</style>
